#ifndef	__RECORD_H_
#define __RECORD_H_

#include <stdio.h>
#include "Attribute.h"
#include "Schema.h"



class Record {

protected:	
	Attribute *myData;
	int numAtts;
	int mySize;

public:

	// these either get the value or set the value in the record, for attribute i
	// just like for the attribute, these are pretty self-explanatory, except that
	// GetString actualy *copies* the value of the string, so you have to make sure
	// to free it when you are done
	int GetInt (int i);
	double GetDouble (int i);
	char *GetString (int i);
	void SetDouble (double in, int i);
	void SetInt (int in, int i);
	void SetString (char *in, int i);
	
	// Prints the record
	void Print (Schema &mySchema);

	// returns the length of the record
	int GetLength ();

	// these are all from the assignment
	Record ();
	~Record ();
	int FromBinary (char *here);
	int ToBinary (char *here);
	int SuckNextRecord (Schema &mySchema, FILE *textFile);
	void Consume (Record &fromMe);
};



#endif /* __RECORD_H_ */
